class Book extends Media{
    String name;
    double price;

    public Book(String name, double price) {
        this.name = name;
        this.price = price;
    }

    public double getDailyRent() {
        return 0.01*price;
    }
}
class DVD extends Media{
    String name;

    public DVD(String name) {
        this.name = name;
    }

    @Override
    public double getDailyRent() {
        return 1;
    }
}
class Media{
    public double getDailyRent(){
        return 0;
    }
}
class MediaShop{
    static double calculateRent(Media[] medias, int days){
        double sum = 0;
        for (Media t : medias){
            if (t instanceof Book){
                sum += t.getDailyRent()*days;
            } else if (t instanceof DVD) {
                sum += t.getDailyRent()*days;
            }
        }
        return sum;
    }
}